<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>

		<link href="css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="css/jiazai.css" />
		<link rel="stylesheet" type="text/css" href="css/index1.css"/>
	</head>

	<body style="background: #f5f8ff;">
		<div id="app">
			<!-- 加载中动画 -->
			<div id='jiazai-ani' v-if='jiazai'>
				<div class="arc"></div>
				<h1><span>LOADING</span></h1>
			</div>
			<!-- 加载中动画 -->
			<div class="fixed-hea">
				<div class="dis-spa hea-con">
					<img src="img/order.svg" style="height: 25px;opacity: 0;" />
					<div class="dis-cen hea-btn-wrap">
						<span @tap="type='buy'" :class="{'btn-active':type=='buy'}">购买</span>
						<span @tap="type='sell'" :class="{'btn-active':type=='sell'}">出售</span>
					</div>
					<img @tap="_indexOpenHref({url:'otc-order.html',id:'otcOrder'})" src="img/order.svg" style="height: 25px;" />
				</div>
				<div class="dis-spa chan-coins">
					<span class='coins-active'>BTC</span>
					<span>ETH</span>
					<span>USDT</span>
					<span>BP</span>
				</div>
			</div>
			<div class="sc-content">
				<div>
					<div v-if="type=='buy'">
						<div class="otc-list-info" v-for="(val,index) in 10" :key='index'>
							<div class="dis-spa logo-wrap">
								<p class='dis-cen'>
									<img src="img/coins.png" style="width: 25px;" />
									<span>BTC</span>
								</p>
								<p>
									成交776，成交率98%
								</p>
							</div>
							<div class="dis-spa coins-count">
								<span>数量：120.012</span>
								<span>单价</span>
							</div>
							<div class="dis-spa coins-max">
								<span>限量：0.222-4545</span>
								<span>￥2645.00</span>
							</div>
							<div class="dis-spa coins-pay">
								<p>
									<img src="img/pay-card.png" />
									<img src="img/pay-alipy.png" />
									<img src="img/pay-weixin.png" />
								</p>
								<p @tap="pay(val)">购买</p>
							</div>
						</div>
					</div>
					<div v-if="type=='sell'">
						<div class="otc-list-info" v-for="(val,index) in 10" :key='index'>
							<div class="dis-spa logo-wrap">
								<p class='dis-cen'>
									<img src="img/coins.png" style="width: 25px;" />
									<span>BTC</span>
								</p>
								<p>
									成交776，成交率98%
								</p>
							</div>
							<div class="dis-spa coins-count">
								<span>数量：120.012</span>
								<span>单价</span>
							</div>
							<div class="dis-spa coins-max">
								<span>限量：0.222-4545</span>
								<span>￥2645.00</span>
							</div>
							<div class="dis-spa coins-pay">
								<p>
									<img src="img/pay-card.png" />
									<img src="img/pay-alipy.png" />
									<img src="img/pay-weixin.png" />
								</p>
								<p @tap="goSell(val)" class='sell-btn'>出售</p>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>

		<script src="js/comm.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/mui.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/vue.min.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript" charset="utf-8">
			var app = new Vue({
				el: '#app',
				data: {
					jiazai: false,
					//buy:购买   sell:出售  
					type: 'buy'
				},
				methods: {
					//购买
					pay: function(val) {
						var web = _indexOpenHref({
							url: 'coins-pay.html',
							id: 'coinsPay'
						});
					},
					//出售
					goSell:function(val){
						var web = _indexOpenHref({
							url: 'coins-sell.html',
							id: 'coinsSell'
						});
					}
				}
			});
			mui.init({
				pullRefresh: {
					container: '#app',
					down: {
						style: 'circle',
						callback: function() {
							mui('#app').pullRefresh().endPulldown();
						}
					},
					up: {
						//						auto: true,
						//						contentrefresh: '正在加载...',
						//						callback: pullupRefresh
					}
				}
			});

			var first = null;
			mui.back = function() {
				//首次按键，提示‘再按一次退出应用’
				if(!first) {
					first = new Date().getTime();
					plus.nativeUI.toast("再按一次退出程序");
					setTimeout(function() {
						first = null;
					}, 1000);
				} else {
					if(new Date().getTime() - first < 1000) {
						plus.runtime.quit();
					}
				}
			};
		</script>
	</body>

</html>